<?php

namespace App\Http\Requests\Ums;

use Illuminate\Foundation\Http\FormRequest;

class AdminUpdateSelfRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array<string, mixed>
     */
    public function rules()
    {
        return [
            'detail_id' => 'required|integer',
            'realname' => 'required|max:255',
            'phone' => 'nullable|regex:/^1[3456789]\d{9}$/',
            'email' => 'nullable|email',
        ];
    }
    public function attributes()
    {
        return [
            'detail_id' => '用户ID',
            'realname' => '姓名',
            'phone' => '手机号',
            'email' => '邮箱',
        ];
    }
}
